
use std::fmt;

struct Structure(i32);

// 为了使用'{}'标记，必须手动实现Displaty trait
impl fmt::Display for Structure {
    // fmt的签名必须如下
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.0)
    }
}

fn main() {
    println!("{}", Structure(123));
}